import Ax from '../api';

export default {
  componentAdd: (param) => Ax.post(`/componentConfig/add`, param),
  componentImport: (param) => Ax.post(`/componentConfig/import`, param),
  componentExport: (query) => Ax.get(`/componentConfig/export?_id=${query.componentId}`),
  componentClone: (param) => Ax.post(`/componentConfig/clone`, param),
  componentEdit: (param) => Ax.put(`/componentConfig/edit`, param),
  componentDelete: (query) => Ax.delete(`/componentConfig/delete?_id=${query.componentId}`),
  componentList: (param) => Ax.post(`/componentConfig/list`, param),
  componentDetail: (query) => Ax.get(`/componentConfig/detail?_id=${query.componentId}`),
  componentFileUpdate: (param) => Ax.post(`/componentConfig/file/update`, param),
  componentAvailableAssetList: (query) => Ax.get(`/componentConfig/available/assets/list`),
  componentWidgetList: (query) => Ax.get(`/componentConfig/widget/list?widgetType=${query.widgetType}&deviceType=${query.deviceType}&protocolId=${query.protocolId}`),
  componentReleaseUseList: (param) => Ax.post(`/componentRelease/use/list`, param),//已发布组件列表
  componentReleaseDetail: (query) => Ax.post(`/componentRelease/detail?_id=${query.componentId}`),//已发布组件详情
  componentReleaseList: (param) => Ax.post(`/componentRelease/list`, param),//发布记录列表
  // 审核相关
  componentReviewList: (param) => Ax.post(`/componentAudit/list`, param),
  componentReviewAdd: (param) => Ax.put(`/componentAudit/add`, param),//提交审核
  componentReviewDelete: (param) => Ax.delete(`/componentAudit/delete?_id=${param.componentId}`),//撤销审核
  componentReviewHandle: (param) => Ax.put(`/componentAudit/edit`, param),
};
